package edu.nf.llmtest.common.converter;

import edu.nf.llmtest.model.document.SessionDoc;
import edu.nf.llmtest.model.entity.Session;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * @ Author bin
 * @ Create  2025/10/30 下午3:29
 * 会话类转换器
 **/
@Mapper(componentModel = "spring")
public interface SessionConverter {
        @Mappings(
                {
                    @Mapping(source = "sessionId", target = "sessionId"),
                    @Mapping(source = "userId", target = "userId"),
                    @Mapping(source = "title", target = "title"),
                    @Mapping(source = "createTime", target = "createTime")
                }
        )
        SessionDoc convertSessionDoc(Session session);

        @Mappings(
                {
                        @Mapping(source = "sessionId", target = "sessionId"),
                        @Mapping(source = "userId", target = "userId"),
                        @Mapping(source = "title", target = "title"),
                        @Mapping(source = "createTime", target = "createTime")
                }
        )
        Session convertSession(SessionDoc sessionDoc);
}
